package com.jie.jie.mvp.persenter;

import com.jaydenxiao.common.baserx.RxSubscriber;
import com.jie.jie.mvp.contract.Meicontract;
import com.jie.jie.mvp.model.MeiziBean;

import java.util.List;

/**
 * Created by jie on 2017/1/23.
 */

public class MeiPresenter extends Meicontract.Presenter{
    @Override
    public void getMEizi(int page) {
        mModel.getMeizi(page).subscribe(new RxSubscriber<List<MeiziBean>>(mContext,true) {
            @Override
            protected void _onNext(List<MeiziBean> meiziBeen) {
                mView.stopLoading();
                mView.returnMeizi(meiziBeen);
            }

            @Override
            protected void _onError(String message) {

            }
        });
    }

    @Override
    public void getMizi(int page, String url) {
        mModel.getmizi(page, url).subscribe(new RxSubscriber<List<MeiziBean>>(mContext,false) {
            @Override
            protected void _onNext(List<MeiziBean> meiziBeen) {
                mView.stopLoading();
                mView.returnMizi(meiziBeen);
            }

            @Override
            protected void _onError(String message) {

            }
        });
    }
}
